Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close streams properly #487

Merged
merged 3 commits into from
Apr 27, 2021
Merged

Conversation

brunofarache
Copy link
Contributor

Part of #485.

In many places Closeable instances such as OutputStream, InputStream and Writer weren't being closed properly in finally blocks. This may cause memory leaks if exceptions are thrown while writing/reading to those streams.

Tried to use try-with-resources as much as possible, only in few cases closing in finally blocks made sense.

Copy link
Member

@pickypg pickypg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a nitpick.

@brunofarache brunofarache requested a review from pickypg April 27, 2021 20:25
@pickypg pickypg merged commit 6255ac5 into elastic:main Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants